package com.vhall.component.entity.room.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @author shimingming
 * @since 2023/6/15 14:50
 */
@Getter
@AllArgsConstructor
public enum DocumentTransNameEnum {


    TO_BE_TRANSCODED(1, "待转码"),
    TRANSCODING(2, "转码中"),
    TRANSCODING_SUCCESSFUL(3, "转码成功"),
    TRANSCODING_FAILED(4, "转码失败"),

    ;

    private Integer key;

    private String describe;


    public static String getDescription(Integer value) {
        DocumentTransNameEnum parse = parse(value);
        if (parse != null) {
            return parse.getDescribe();
        }
        return StringUtils.EMPTY;
    }

    public static DocumentTransNameEnum parse(Integer value) {
        for (DocumentTransNameEnum anEnum : DocumentTransNameEnum.values()) {
            if (anEnum.getKey().equals(value)) {
                return anEnum;
            }
        }
        return null;
    }
}